import { createBrowserRouter } from "react-router-dom";
import App from "../App";
import FunctionList from "../views/functions/FunctionList";
import FunctionCreate from "../views/functions/FunctionCreate";
import FunctionEdit from "../views/functions/FunctionEdit";
import FunctionStore from "../views/functions/FunctionStore";
import InstanceList from "../views/instances/InstanceList";
import Login from "../views/auth/Login";
import Register from "../views/auth/Register";

const router = createBrowserRouter([
  {
    path: "/",
    element: <App />,
    children: [
      {
        path: "/",
        element: <FunctionList />,
      },
      {
        path: "/functions",
        element: <FunctionList />,
      },
      {
        path: "/functions/create",
        element: <FunctionCreate />,
      },
      {
        path: "/functions/edit/:id",
        element: <FunctionEdit />,
      },
      {
        path: "/function-store",
        element: <FunctionStore />,
      },
      {
        path: "/instances",
        element: <InstanceList />,
      },
      {
        path: "/login",
        element: <Login />,
      },
      {
        path: "/register",
        element: <Register />,
      },
    ],
  },
]);

export default router;